<?php
$username=$_POST['username'];
$password=$_POST['password'];
$phone=$_POST['phone'];
$date = date('Ymd');


$conn = new mysqli("localhost", "root", "123", "commission");
if ($conn->connect_error) {
    die("服务器连接失败: " . $conn->connect_error);
}

$sql = "INSERT INTO userinformation (name, date, contract, password) VALUES ('".$username. "', '".$date."', '".$phone."', '".$password."')";
if ($conn->query($sql) === TRUE) {
    $userid=mysqli_insert_id($conn);
    echo "注册成功,您的编号是：" . mysqli_insert_id($conn);
} else {
    echo "注册失败，请重新注册";
}
$conn->close();
?>
